package com.ruoyi.app.mapper;

import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.app.domain.ShopUser;
import com.ruoyi.app.domain.vo.ShopUserVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 店铺用户管理Mapper接口
 * 
 * @author ruoyi
 * @date 2024-07-07
 */
public interface ShopUserMapper extends BaseMapper<ShopUser> {

    /**
     * 根据用户ID查询店铺用户列表
     * @param userId
     * @return
     */
    @Select("select SHOP_ID,USER_ID,SHOP_NAME FROM shop_user su INNER JOIN  shop_info si ON su.SHOP_ID = si.ID AND si.DEL_FLAG = 0 WHERE su.DEL_FLAG = 0 AND su.USER_ID = #{userId}")
    List<ShopUserVo> listShopUserByUserId(@Param("userId") String userId);
}
